Cudatashader Example¶
[1]:
from cuXfilter import charts
import cuXfilter
from bokeh import palettes
from cuXfilter.layouts import layout_2
Load cuXfilter dataframe¶
[2]:
cux_df1 = cuXfilter.DataFrame.from_arrow('/home/ajay/data/nyc_taxi_1.arrow')
Define Charts¶
[3]:
chart1 = charts.cudatashader.scatter_geo(x='dropoff_x',
y='dropoff_y',
aggregate_fn='count',
x_range=(-8239910.23,-8229529.24),
y_range=(4968481.34,4983152.92))
chart2 = charts.bokeh.bar('passenger_count', data_points=9)
Create dashboard¶
[4]:
d1 = cux_df1.dashboard([chart1, chart2], layout_2)
[5]:
# d1.show('url you want the dashboard to run') remote dashboard:
# d1.app('10.110.47.43:8888') If you are using jupyter remotely, use this line instead of second, and replace url with current notebook url
#d1.app() for local interactive behavior
#d1.preview() for just a view of the dashboard, interaciton not available. Recommended way to generate when uploading to git remote site
await d1.preview()
Export the queried data into a dataframe¶
[6]:
queried_df = d1.export()
no querying done, returning original dataframe